<template>
  <div class="cover" :style="{ width: width, height: height }">
    <router-link
      :to="{ name: 'video', params: { uvid: this.uvid } }"
      target="_blank"
    >
    <el-image :src="url" fit="cover" class="img" lazy>
      <div slot="error" style="width: 100%; height: 100%;">
        <el-empty style="width: 100%; height: 100%;"></el-empty>
      </div>
    </el-image>
    </router-link>
  </div>
</template>

<script>
export default {
  props: {
    url: {
      type: String,
    },
    width: {
      type: String,
      default: "100%",
    },
    height: {
      type: String,
      default: "102px",
    },
    // 跳转参数
    uvid: {
      type: String,
    },
  },
};
</script>

<style lang="scss" scoped>
.cover {
  .img {
    width: 100%;
    height: 100%;
  }
  background-color: #f6f6f7;
  cursor: pointer;
}
</style>